package org.lisen.controlleradvice.handler;

import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

/**
 * 全局数据绑定
 * @author laughing
 * @date 2020/9/26
 * @site https://www.lisen.org
 */
@RestControllerAdvice
public class GlobalDataAttribute {

    @ModelAttribute(name = "person")
    public Map<String,Object> modelAttribute(){
        Map<String,Object> map = new HashMap<>();
        map.put("name","张三");
        return map;
    }

}
